Convergent charging method and device

ABSTRACT

A convergent charging method includes determining, by a session management function (SMF), a charging type of a first data flow and a charging type of a second data flow, where the charging type is online charging or offline charging. The method further includes sending, by the SMF, a first message to a charging server using an online-offline convergent charging session based on the charging types of the first data flow and the second data flow, where the first message includes a first online charging request of the first data flow or a first offline charging request of the second data flow, and the online-offline convergent charging session is used to send the first online charging request and the first offline charging request.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/696,381, filed on Nov. 26, 2019, which is a continuation ofInternational Patent Application No. PCT/CN2018/098229, filed on Aug. 2,2018, which claims priority to Chinese Patent Application No.201711139241.4, filed on Nov. 16, 2017. All of the aforementioned patentapplications are hereby incorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the communications field, and morespecifically, to a convergent charging method and a device.

BACKGROUND

Currently, an online charging system (OCS) and an offline chargingsystem are included in each of charging architectures in a 3rdgeneration (3G) mobile communications technology and a 4th generation(4G) mobile communications technology. In the OCS, a charging triggerfunction (CTF) is connected to an online charging function (OCF) throughan Ro interface. In the offline charging system, the CTF is connected toa charging data function (CDF) through a radio frequency interface.Based on the charging architecture in which online charging is separatedfrom offline charging, when configuring a product, an operator isconfronted with complex coordination and cooperation between a pluralityof systems, limiting flexibility of service provisioning of theoperator. In a 5th generation mobile communications technology (5G),there are many limitations on industry application support, and becausethe charging system is limited by intervention of an external system inonline charging and offline charging, processing performed by thecharging system is complex.

SUMMARY

This application provides a convergent charging method and a device, torequest online charging and offline charging based on an online-offlineconvergent charging session, simplify a charging architecture, andimprove flexibility of service provisioning of an operator.

According to a first aspect, a convergent charging method is provided.The method includes determining, by a session management function (SMF),charging type of a first data flow and a second data flow, where thecharging type is online charging or offline charging, and sending, bythe SMF, a first message to a charging server using an online-offlineconvergent charging session based on the charging types of the firstdata flow and the second data flow, where the first message includes afirst online charging request of the first data flow, or the firstmessage includes a first offline charging request of the second dataflow, or the first message includes a first online charging request ofthe first data flow and a first offline charging request of the seconddata flow, and the online-offline convergent charging session is used tosend the first online charging request and the first offline chargingrequest.

Therefore, in this embodiment of this application, the SMF sends thefirst online charging request to the charging server using theonline-offline convergent charging session, or the SMF sends the firstoffline charging request to the charging server using the online-offlineconvergent charging session, or the SMF sends the first online chargingrequest and the first offline charging request to the charging serverusing the online-offline convergent charging session, to request onlinecharging and offline charging based on the online-offline convergentcharging session, simplify a charging architecture, and improveflexibility of service provisioning of an operator.

With reference to the first aspect, in some implementations of the firstaspect, the first online charging request includes a first quotaapplication, and the first offline charging request includes consumptioninformation statistics, or the first offline charging request includes asecond quota application and first indication information, indicateindicating that an applied second quota is a virtual quota.

With reference to the first aspect, in some implementations of the firstaspect, the SMF receives, using the online-offline convergent chargingsession, a second message sent by the charging server, where the secondmessage includes at least one of response information of the firstonline charging request or response information of the first offlinecharging request, the response information of the first online chargingrequest includes a first quota allocated to the first quota applicationof the first data flow, and when the first offline charging requestincludes the consumption information statistics, the responseinformation of the first offline charging includes a processing resultof the consumption information statistics, or when the first offlinecharging request includes the second quota application and firstindication information, the response information of the first offlinecharging includes a second quota allocated to the second quotaapplication of the second data flow and the first indicationinformation.

With reference to the first aspect, in some implementations of the firstaspect, the second message further includes an identifier correspondingto the first quota, and the identifier is used to indicate, when useinformation of the first quota is reported to the charging server, tothe charging server that the reported use information is usage of thefirst quota.

With reference to the first aspect, in some implementations of the firstaspect, when a first charging trigger condition of the first data flowis satisfied, the SMF sends a third message to the charging server usingthe online-offline convergent charging session, where the third messageincludes a second online charging request of the first data flow, orwhen a second charging trigger condition of the second data flow issatisfied, the SMF sends a third message to the charging server usingthe online-offline convergent charging session, where the third messageincludes a second offline charging request of the second data flow, orwhen a first charging trigger condition of the first data flow issatisfied and a second charging trigger condition of the second dataflow is satisfied, the SMF sends a third message to the charging serverusing the online-offline convergent charging session, where the thirdmessage includes a second online charging request of the first data flowand a second offline charging request of the second data flow.

With reference to the first aspect, in some implementations of the firstaspect, the second online charging request includes at least one of athird quota application and use information of the first quota, and thesecond offline charging request includes consumption informationstatistics, or the second offline charging request includes secondindication information and at least one of use information of the secondquota and a fourth quota application, and the second indicationinformation is used to indicate that the fourth quota or the useinformation of the second quota is a virtual quota.

With reference to the first aspect, in some implementations of the firstaspect, the third message further includes at least one of thirdindication information corresponding to the first data flow and fourthindication information corresponding to the second data flow, where thethird indication information is used to instruct to perform onlinecharging on the first data flow, and the fourth indication informationis used to instruct to perform offline charging on the second data flow.

With reference to the first aspect, in some implementations of the firstaspect, before the SMF sends the third message to the charging serverusing the online-offline convergent charging session, the SMF receives,using the online-offline convergent charging session, a fourth messagesent by the charging server, where the fourth message is used toinstruct to send the third message using the online-offline convergentcharging session, and when the first data flow and the second data flowcorrespond to a same rating group, when the fourth message includes thesame rating group, the third message includes the second online chargingrequest of the first data flow and the second offline charging requestof the second data flow, or when the fourth message includes the samerating group and the third indication information, the third messageincludes the second online charging request of the first data flow, orwhen the fourth message includes the same rating group and the fourthindication information, the third message includes the second offlinecharging request of the second data flow.

With reference to the first aspect, in some implementations of the firstaspect, before sending the first message, the SMF sends anonline-offline convergent charging session establishment request to thecharging server, or the first message includes an online-offlineconvergent charging session establishment request.

With reference to the first aspect, in some implementations of the firstaspect, in the online-offline convergent charging session, when thecharging type of the first data flow is online charging and an onlinecharging trigger condition of the first data flow is satisfied, and thesecond data flow is offline charging and an offline charging triggercondition of the second data flow is satisfied, the SMF sends the onlinecharging request of the first data flow and the offline charging requestof the second data flow.

With reference to the first aspect, in some implementations of the firstaspect, when determining that online charging and offline charging donot need to be performed, the SMF sends a fifth message to the chargingserver, to request the charging server to terminate the online-offlineconvergent charging session.

With reference to the first aspect, in some implementations of the firstaspect, the SMF obtains a static charging policy or obtains a dynamiccharging policy of a policy control function (PCF), where the dynamiccharging policy and the static charging policy include the chargingtypes of the first data flow and the second data flow, and the SMFdetermines, according to the dynamic charging policy or the staticcharging policy, that charging type of the first data flow is onlinecharging and charging type of the second data flow is offline charging.

According to a second aspect, a convergent charging method is provided.The method includes receiving, by a charging server using anonline-offline convergent charging session, a first message sent by aSMF, where the first message includes a first online charging request ofa first data flow, or the first message includes a first offlinecharging request of a second data flow, or the first message includes afirst online charging request of the first data flow and a first offlinecharging request of the second data flow, and the online-offlineconvergent charging session is used to send the first online chargingrequest and the first offline charging request, and sending, by thecharging server, a second message to the SMF, where when the firstmessage includes the first online charging request of the first dataflow, the second message includes response information of the firstonline charging request, when the first message includes the firstoffline charging request of the second data flow, the second messageincludes response information of the first offline charging request, orwhen the first message includes the first online charging request of thefirst data flow and the first offline charging request of the seconddata flow, the second message includes response information of the firstonline charging request and response information of the first offlinecharging request.

With reference to the second aspect, in some implementations of thesecond aspect, the response information of the first online chargingrequest includes a first quota allocated to a first quota application ofthe first data flow, and when the first offline charging requestincludes consumption information statistics, the response information ofthe first offline charging request includes a processing result of theconsumption information statistics, or when the first offline chargingrequest includes a second quota application and a first indicationinformation, the response information of the first offline chargingrequest includes a second quota allocated to the second quotaapplication of the second data flow and the first indicationinformation.

With reference to the second aspect, in some implementations of thesecond aspect, the charging server receives, using the online-offlineconvergent charging session, a third message sent by the SMF, where thethird message includes a second online charging request of the firstdata flow, or a second offline charging request of the second data flow,or a second online charging request of the first data flow and a secondoffline charging request of the second data flow.

With reference to the second aspect, in some implementations of thesecond aspect, the second online charging request includes at least oneof a third quota application and consumption information of the firstquota, and the second offline charging request includes consumptioninformation statistics, or the second offline charging request includesconsumption information of the second quota or a fourth quotaapplication, and second indication information, and the secondindication information is used to indicate that a fourth quota is avirtual quota.

With reference to the second aspect, in some implementations of thesecond aspect, the third message further includes at least one of thirdindication information corresponding to the first data flow and fourthindication information corresponding to the second data flow, where thethird indication information is used to instruct to perform onlinecharging on the first data flow, and the fourth indication informationis used to instruct to perform offline charging on the second data flow.

With reference to the second aspect, in some implementations of thesecond aspect, the charging server deducts the reserved first quotabased on the use information of the first quota, or the charging serverallocates the third quota based on the third quota application, or thecharging server generates a charging data record based on theconsumption information statistics, or the charging server generates acharging data record based on the consumption information of the secondquota and the second indication information, or the charging serverallocates the fourth quota based on the fourth quota application and thesecond indication information.

With reference to the second aspect, in some implementations of thesecond aspect, before receiving the third message, the charging serversends a fourth message to the SMF using the online-offline convergentcharging session, where the fourth message is used to instruct to sendthe third message using the online-offline convergent charging session,and when the first data flow and the second data flow correspond to asame rating group, when the fourth message includes the same ratinggroup, the third message includes the second online charging request ofthe first data flow and the second offline charging request of thesecond data flow, or when the fourth message includes the same ratinggroup and the third indication information, the third message includesthe second online charging request of the first data flow, or when thefourth message includes the same rating group and the fourth indicationinformation, the third message includes the second offline chargingrequest of the second data flow.

With reference to the second aspect, in some implementations of thesecond aspect, before receiving the first message, the charging serverreceives an online-offline convergent charging session request sent bythe SMF, to establish the online-offline convergent charging session, orthe charging server receives the first message including anonline-offline convergent charging session establishment request, toestablish the online-offline convergent charging session.

With reference to the second aspect, in some implementations of thesecond aspect, in the online-offline convergent charging session, whenthe charging type of the first data flow is online charging and anonline charging trigger condition of the first data flow is satisfied,and the second data flow is offline charging and an offline chargingtrigger condition of the second data flow is satisfied, the chargingserver receives the online charging request of the first data flow andthe offline charging request of the second data flow.

With reference to the second aspect, in some implementations of thesecond aspect, the charging server receives a fifth message sent by theSMF, and the charging server terminates the online-offline convergentcharging session based on the fifth message.

According to the third aspect, a convergent charging method is provided.The method includes receiving, by a charging server using anonline-offline convergent charging session, a first message sent by aSMF, where the first message includes a first quota application of afirst data flow, or the first message includes a second quotaapplication of a second data flow, or the first message includes a firstquota application of a first data flow and a second quota application ofthe second data flow, and the online-offline convergent charging sessionis used to send a first online charging request and a first offlinecharging request, determining, by the charging server, charging types ofthe first data flow and the second data flow, where the charging type isonline charging or offline charging, and sending, by the chargingserver, a second message to the SMF using the online-offline convergentcharging session based on the charging types of the first data flow andthe second data flow, where when the first message includes the firstquota application of the first data flow, the second message includes afirst quota allocated by the charging server to the first data flow,when the first message includes the second quota application of thesecond data flow, the second message includes the second quotaapplication of the second data flow and first indication informationallocated to the second data flow, and the first indication informationis used to instruct the SMF to perform offline charging on the seconddata flow, or the second message includes a second quota that areallocated by the charging server to the second data flow and secondindication information, and the second indication information is used toindicate that the second quota is a virtual quota, or when the firstmessage includes the first quota application of the first data flow andthe second quota application of the second data flow, the second messageincludes a first quota allocated by the charging server to the firstdata flow, a second quota allocated by the charging server to the seconddata flow, and first indication information allocated to the second dataflow, and the first indication information is used to instruct the SMFto perform offline charging on the second data flow, or the secondmessage includes a first quota allocated by the charging server to thefirst data flow and the second quota that are allocated by the chargingserver to the second data flow and second indication information, andthe second indication information is used to indicate that the secondquota is a virtual quota.

With reference to the third aspect, in some implementations of the thirdaspect, when it is determined that a charging type of a service dataflow of a first service is online charging, the second message furtherincludes service data flow information corresponding to the first quota,or when it is determined that a charging type of a service data flow ofthe first service is offline charging, the second message includesservice data flow information corresponding to the first indicationinformation, or when it is determined that a charging type of a servicedata flow of the first service is offline charging, the second messageincludes service data flow information corresponding to the secondquota.

With reference to the third aspect, in some implementations of the thirdaspect, when the first data flow and the second data flow use a samerating group, the second message further includes a flow identifiercorresponding to the second data flow, the flow identifier is used toinstruct the SMF to report consumption information statistics of thesecond data flow corresponding to the flow identifier.

With reference to the third aspect, in some implementations of the thirdaspect, the charging server receives, using the online-offlineconvergent charging session, a third message sent by the SMF, where thethird message includes at least one of a third quota application of thefirst data flow and consumption information of the first quota, or theconsumption information statistics of the second data flow or a fourthquota application, and second indication information, or consumptioninformation of the second quota and second indication information, andthe second indication information is used to indicate a virtual quota.

With reference to the third aspect, in some implementations of the thirdaspect, the third message further includes at least one of thirdindication information corresponding to the first data flow and fourthindication information corresponding to the second data flow, where thethird indication information is used to instruct to perform the onlinecharging on the first data flow, and the fourth indication informationis used to instruct to perform the offline charging on the second dataflow.

With reference to the third aspect, in some implementations of the thirdaspect, the charging server deducts the reserved first quota based onthe consumption information of the first quota, or the charging serverallocates the third quota based on the third quota application, or thecharging server generates a charging data record based on theconsumption information statistics of the second data flow, or thecharging server allocates a fourth quota based on the fourth quotaapplication and the second indication information, or the chargingserver generates a charging data record based on the consumptioninformation of the second quota and the second indication information.

With reference to the third aspect, in some implementations of the thirdaspect, before receiving the third message, the charging server sends afourth message to the SMF using the online-offline convergent chargingsession, where the fourth message is used to instruct to send the thirdmessage using the online-offline convergent charging session, and whenthe first data flow and the second data flow correspond to a same ratinggroup, when the fourth message includes the same rating group, the thirdmessage includes a second online charging request of the first data flowand a second offline charging request of the second data flow, or whenthe fourth message includes the same rating group and the thirdindication information, the third message includes the second onlinecharging request of the first data flow, or when the fourth messageincludes the same rating group and the fourth indication information,the third message includes the second offline charging request of thesecond data flow.

With reference to the third aspect, in some implementations of the thirdaspect, before receiving the first message, the charging server receivesan online-offline convergent charging session request sent by the SMF,to establish the online-offline convergent charging session, or thecharging server receives the first message including an online-offlineconvergent charging session establishment request, to establish theonline-offline convergent charging session.

With reference to the third aspect, in some implementations of the thirdaspect, when a PCF establishes a protocol data unit (PDU) session, thecharging server receives a charging policy sent by the PCF andcorresponding to the PDU session, or when receiving the first messagesent by the SMF, the charging server requests a charging policycorresponding to a PDU session from a PCF.

With reference to the third aspect, in some implementations of the thirdaspect, the charging server determines, according to the chargingpolicy, that the charging type of the first data flow is online chargingand the charging type of the second data flow is offline charging.

With reference to the third aspect, in some implementations of the thirdaspect, the charging server receives a fifth message sent by the SMF,and the charging server terminates the online-offline convergentcharging session based on the fifth message.

According to a fourth aspect, a convergent charging method is provided.The method includes sending, by a SMF, a first message to a chargingserver using an online-offline convergent charging session, where thefirst message includes a first quota application of a first data flow,or the first message includes a second quota application of the seconddata flow, or the first message includes a first quota application of afirst data flow and a second quota application of the second data flow,and the online-offline convergent charging session is used to send afirst online charging request and a first offline charging request, andreceiving, by the SMF using the online-offline convergent chargingsession, a second message sent by the charging server, where when thefirst message includes the first quota application of the first dataflow, the second message includes a first quota allocated by thecharging server to the first data flow, when the first message includesthe second quota application of the second data flow, the second messageincludes a second quota allocated to the second data flow and firstindication information allocated to the second data flow, and the firstindication information is used to instruct the SMF to perform offlinecharging on the second data flow, or the second message includes thesecond quota that are allocated by the charging server to the seconddata flow and second indication information, and the second indicationinformation is used to indicate that the second quota is a virtualquota, or when the first message includes the first quota application ofthe first data flow and the second quota application of the second dataflow, the second message includes a first quota allocated by thecharging server to the first data flow, the second quota application ofthe second data flow, and first indication information allocated to thesecond data flow, and the first indication information is used toinstruct the SMF to perform offline charging on the second data flow, orthe second message includes the first quota allocated by the chargingserver to the first data flow and the second quota that are allocated bythe charging server to the second data flow and second indicationinformation, and the second indication information is used to indicatethat the second quota is a virtual quota.

With reference to the fourth aspect, in some implementations of thefourth aspect, when a first charging trigger condition of the first dataflow is satisfied, the SMF sends a third message to the charging serverusing the online-offline convergent charging session, where the thirdmessage includes at least one of a third quota application of the firstdata flow and consumption information of the first quota, or when asecond charging trigger condition of the second data flow is satisfied,the SMF sends a third message to the charging server using theonline-offline convergent charging session, where the third messageincludes consumption information statistics of the second data flow or afourth quota application, and second indication information, and thesecond indication information is used to indicate that a fourth quota isa virtual quota, or when a second charging trigger condition of thesecond data flow is satisfied, the SMF sends a third message to thecharging server using the online-offline convergent charging session,where the third message includes use information statistics of thesecond quota or a fourth quota application, and second indicationinformation, and the second indication information is used to indicatethat the fourth quota is a virtual quota, or when a first chargingtrigger condition of the first data flow is satisfied and a secondcharging trigger condition of the second data flow is satisfied, the SMFsends a third message to the charging server using the online-offlineconvergent charging session, where the third message includes at leastone of a third quota application of the first data flow and consumptioninformation of the first quota, consumption information statistics ofthe second data flow or a fourth quota application, and secondindication information, and the second indication information is used toindicate that the fourth quota is a virtual quota, or the third messageincludes at least one of a third quota application of the first dataflow and consumption information of the first quota, use informationstatistics of the second quota or a fourth quota application, and secondindication information, and the second indication information is used toindicate that the fourth quota is a virtual quota.

With reference to the fourth aspect, in some implementations of thefourth aspect, the third message further includes at least one of thirdindication information corresponding to the first data flow and fourthindication information corresponding to the second data flow, where thethird indication information is used to instruct to perform the onlinecharging on the first data flow, and the fourth indication informationis used to instruct to perform the offline charging on the second dataflow.

With reference to the fourth aspect, in some implementations of thefourth aspect, before the SMF sends the third message to the chargingserver using the online-offline convergent charging session, the SMFreceives, using the online-offline convergent charging session, a fourthmessage sent by the charging server, where the fourth message is used toinstruct to send the third message using the online-offline convergentcharging session, and when the first data flow and the second data flowcorrespond to a same rating group, when the fourth message includes thesame rating group, the third message includes a second online chargingrequest of the first data flow and a second offline charging request ofthe second data flow, or when the fourth message includes the samerating group and the third indication information, the third messageincludes the second online charging request of the first data flow, orwhen the fourth message includes the same rating group and the fourthindication information, the third message includes the second offlinecharging request of the second data flow.

With reference to the fourth aspect, in some implementations of thefourth aspect, before sending the first message, the SMF sends anonline-offline convergent charging session establishment request to thecharging server, or the first message includes an online-offlineconvergent charging session establishment request.

With reference to the fourth aspect, in some implementations of thefourth aspect, when determining that online charging and offlinecharging do not need to be performed, the SMF sends a fifth message tothe charging server, to request the charging server to terminate theonline-offline convergent charging session.

According to a fifth aspect, a SMF is provided. The SMF includes adetermining module and a sending module that can perform the method inany one of the first aspect or the optional implementations of the firstaspect.

According to a sixth aspect, a charging server is provided. The chargingserver includes a receiving module and a sending module that can performthe method in any one of the second aspect or the optionalimplementations of the second aspect.

According to a seventh aspect, a charging server is provided. Thecharging server includes a receiving module, a determining module, and asending module that can perform the method in any one of the thirdaspect or the optional implementations of the third aspect.

According to an eighth aspect, a SMF is provided. The SMF includes asending module and a receiving module that can perform the method in anyone of the fourth aspect or the optional implementations of the fourthaspect.

According to a ninth aspect, a communications apparatus is provided. Thecommunications apparatus includes a memory and a processor. The memorystores program code that can be used to instruct to perform any one ofthe first aspect or the optional implementations of the first aspect,any one of the second aspect or the optional implementations of thesecond aspect, any one of the third aspect or the optionalimplementations of the third aspect, and any one of the fourth aspect orthe optional implementations of the fourth aspect. When the program codeis executed, the processor can implement various operations performed bythe SMF and the charging server in the foregoing methods.

According to a tenth aspect, a chip system is provided. The chip systemincludes at least one processor. The at least one processor isconfigured to execute a stored instruction, to enable a SMF to performthe method in any one of the first aspect or the optionalimplementations of the first aspect and the method in any one of thefourth aspect or the optional implementations of the fourth aspect.

According to an eleventh aspect, a chip system is provided. The chipsystem includes at least one processor. The at least one processor isconfigured to execute a stored instruction, to enable a charging serverto perform the method in any one of the second aspect or the optionalimplementations of the second aspect and the method in any one of thethird aspect or the optional implementations of the third aspect.

According to a twelfth aspect, a computer program product is provided.The computer program product includes an instruction. When theinstruction is executed, a SMF is enabled to perform the method in anyone of the first aspect or the optional implementations of the firstaspect and the method in any one of the fourth aspect or the optionalimplementations of the fourth aspect.

According to a thirteenth aspect, a computer program product isprovided. The computer program product includes an instruction. When theinstruction is executed, a charging server is enabled to perform themethod in any one of the second aspect or the optional implementationsof the second aspect and the method in any one of the third aspect orthe optional implementations of the third aspect.

According to a fourteenth aspect, a computer storage medium is provided.The computer storage medium stores a program instruction. When theinstruction is executed, a SMF is enabled to perform the method in anyone of the first aspect or the optional implementations of the firstaspect and the method in any one of the fourth aspect or the optionalimplementations of the fourth aspect.

According to a fifteenth aspect, a computer storage medium is provided.The computer storage medium stores a program instruction. When theinstruction is executed, a charging server is enabled to perform themethod in any one of the second aspect or the optional implementationsof the second aspect and the method in any one of the third aspect orthe optional implementations of the third aspect.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic block diagram of a wireless communications systemarchitecture of a convergent charging method and a device according toan embodiment of this application.

FIG. 2 is a schematic flowchart of a convergent charging methodaccording to an embodiment of this application.

FIG. 3 is a schematic flowchart of a convergent charging methodaccording to an embodiment of this application.

FIG. 4 is a schematic flowchart of a convergent charging methodaccording to an embodiment of this application.

FIG. 5 is a schematic flowchart of a convergent charging methodaccording to an embodiment of this application.

FIG. 6 is a schematic flowchart of a convergent charging methodaccording to an embodiment of this application.

FIG. 7 is a schematic flowchart of a convergent charging methodaccording to an embodiment of this application.

FIG. 8 is a schematic flowchart of a convergent charging methodaccording to an embodiment of this application.

FIG. 9 is a schematic flowchart of a convergent charging methodaccording to an embodiment of this application.

FIG. 10 is a schematic structural diagram of a SMF according to anembodiment of this application.

FIG. 11 is a schematic structural diagram of a charging server accordingto an embodiment of this application.

FIG. 12 is a schematic structural diagram of a SMF according to anembodiment of this application.

FIG. 13 is a schematic structural diagram of a charging server accordingto an embodiment of this application.

FIG. 14 is a schematic structural diagram of a communications apparatusaccording to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The following describes technical solutions in this application withreference to the accompanying drawings.

For ease of understanding of embodiments of this application, an OCS andan offline charging system in the other approaches are first describedherein before the embodiments of this application are described.

The OCS is a system that performs charging management in real time basedon use of a service. For online charging, quota granting is applied forbefore the service is used, and collected charging information isreported after the service is used, to implement real-time settlement.In 3G and 4G charging architectures, the OCS mainly includes a CTF, anOCF, a user balance management function, and a rating function. The CTFcollects charging request events of a user from a data gateway in a dataservice domain, reports the events to the OCF, and obtains, from theOCF, the charging events and use authorization of a network resourcerequested by a corresponding event. The OCF queries the rating functionand a user balance management function for a service price or a chargingrate and user balance, and decides, after determining, whether to granta use right of a network resource to a user applying for the service.During performance of the service, the OCF is responsible forcalculating service fees in real time, and instructing the CTF toforcibly interrupt the service when the user balance is insufficient formaintaining the existing service.

The offline charging system reports collected charging information aftera service is used, and charging does not affect use of the service inreal time. In the 3G and 4G charging architectures, the offline chargingsystem mainly includes a CTF, a CDF, and a charging gateway function(CGF). The CTF assembles the charging information into a charging event,and sends the charging event to the CDF through an Rf interface. The CDFconstructs a charging detail record (CDR) using information included inthe charging event, where the CDR is also referred to as a charging datarecord. After generating the CDR, the CDF transfers the CDR to the CGF.The CGF assembles the CDR into a CDR file, and transfers the CDR file toa charging center through a Bx interface, for processing.

Based on the charging architecture in which online charging is separatedfrom offline charging, when configuring a product, an operator isconfronted with complex coordination and cooperation between a pluralityof systems, limiting flexibility of service provisioning of theoperator. In a 5G, there are many limitations on industry applicationsupport, and because the charging system is limited by intervention ofan external system in online charging and offline charging, processingperformed by the charging system is complex.

FIG. 1 is a schematic block diagram of a wireless communications systemarchitecture 100 of a convergent charging method and a device accordingto this application. As shown in FIG. 1, the system architecture 100includes a terminal device 110, an access network device 120, a userplane function 130 (UPF), a data network 140 (DN), an access andmobility management function 150 (AMF), a SMF 160, and a PCF 170. Thefunctional units in FIG. 1 may implement communication by establishing aconnection through a next generation network (NGN) interface. Forexample, the terminal device establishes an air interface connection toa radio access network (RAN) device/the access network (AN) devicethrough a new radio (NR) interface, to transmit user plane data andcontrol plane signaling. The terminal device may establish a controlplane signaling connection to the AMF through an NG interface 1 (N1),the RAN device such as a 5G radio access NodeB (5GNB) may establish auser plane data connection to the UPF through an NG interface 3 (N3),the RAN device may establish a control plane signaling connection to theAMF through an NG interface 2 (N2), the UPF may establish a controlplane signaling connection to the SMF through an NG interface 4 (N4),the UPF may exchange user plane data with the data network through an NGinterface 6 (N6), the AMF may establish a control plane signalingconnection to the SMF through an NG interface 11 (N11), and the SMF mayestablish a control plane signaling connection to the PCF through an NGinterface 7 (N7).

The terminal device may be a user equipment (UE) such as a mobile phoneor a computer, or may be a cellular phone, a cordless phone, a sessioninitiation protocol (SIP) phone, a smartphone, a wireless local loop(WLL) station, a personal digital assistant (PDA), a computer, a laptopcomputer, a handheld communications device, a handheld computing device,a satellite radio device, a wireless modem card, a set top box (STB),customer premise equipment (CPE), or another device for communication ina wireless system.

The access network device may be an AN/RAN device or a network includinga plurality of 5G-AN/5G-RAN nodes. The 5G-AN/5G-RAN node may be anaccess node (AP), a next generation NodeB (gNB), a gNB in a form ofseparating a central unit (CU) from a distributed unit (DU), atransmission/reception point (TRP), a transmission point (TP), oranother specific AP.

The functional units such as the AMF, the SMF, the PCF, and the userplane function may work independently, or may be combined together toimplement some controls functions. For example, the AMF, the SMF, andthe PCF may be combined together as a management device configured toimplement, for the terminal device, access control and mobilitymanagement functions such as access authentication, security encryption,and location registration, SMFs such as establishment, release, andchange of a user plane transmission path, and functions of analyzingsome slice related data (such as a congestion) and terminal devicerelated data. The UPF as a gateway device mainly completes functionssuch as routing and forwarding of user plane data, for example, isresponsible for filtering of a data packet of the terminal device, datatransmission/forwarding, rate control, and charging informationgeneration.

It should be noted that FIG. 1 is merely an example architecturaldiagram. In addition to the functional units shown in FIG. 1, thenetwork architecture may further include another functional unit orfunctional entity, for example, a core network device may furtherinclude another functional unit such as a unified data managementfunction (UDM). This is not limited in this embodiment of thisapplication.

The technical solutions in the embodiments of this application may beapplied to various communications systems, such as a global system ofmobile communications (GSM), a code division multiple access (CDMA)system, a wideband code division multiple access (WCDMA) system, ageneral packet radio service (GPRS) system, a long term evolution (LTE)system, an LTE frequency division duplex (FDD) system, an LTE timedivision duplex (TDD) system, a universal mobile telecommunicationssystem (UMTS), a worldwide interoperability for microwave access (WiMAX)communications system, a future 5G system, or an NR system.

FIG. 2 is a schematic flowchart of a convergent charging method 200according to this application. The method 200 may be applied to thescenario shown in FIG. 1, and certainly, may also be applied to anothercommunication scenario. This is not limited in this embodiment of thisapplication. As shown in FIG. 2, the method 200 includes the followingcontent.

Step 201. A SMF determines charging types of a first data flow and asecond data flow, where the charging type is online charging or offlinecharging.

Step 202. The SMF sends a first message to a charging server using anonline-offline convergent charging session based on the charging typesof the first data flow and the second data flow, where the first messageincludes a first online charging request of the first data flow, or thefirst message includes a first offline charging request of the seconddata flow, or the first message includes a first online charging requestof the first data flow and a first offline charging request of thesecond data flow, and the online-offline convergent charging session isused to send the first online charging request and the first offlinecharging request.

It should be understood that the online-offline convergent chargingsession may be used to process not only online charging but also offlinecharging. The SMF may send the online charging request and the offlinecharging request using a same message, for example, the first message,or the SMF may send the online charging request and the offline chargingrequest using different messages.

For example, the online charging request and the offline chargingrequest are sent using different messages and the online-offlineconvergent charging session. The online charging request is sent using amessage a, and the offline charging request is sent using a message b.Alternatively, the online charging request and the offline chargingrequest may be included in a same message, for example, the onlinecharging request and the offline charging request are included in thefirst message.

Step 203. The charging server receives, using the online-offlineconvergent charging session, the first message sent by the SMF.

Step 204. The charging server sends a second message to the SMF.

When the first message includes the first online charging request of thefirst data flow, the second message includes response information of thefirst online charging request. When the first message includes the firstoffline charging request of the second data flow, the second messageincludes response information of the first offline charging request.When the first message includes the first online charging request of thefirst data flow and the first offline charging request of the seconddata flow, the second message includes response information of the firstonline charging request and response information of the first offlinecharging request.

Step 205. The SMF receives the second message sent by the chargingserver.

Therefore, in this embodiment of this application, the SMF sends thefirst online charging request to the charging server using theonline-offline convergent charging session, or the SMF sends the firstoffline charging request to the charging server using the online-offlineconvergent charging session, or the SMF sends the first online chargingrequest and the first offline charging request to the charging serverusing the online-offline convergent charging session, to request onlinecharging and offline charging based on the online-offline convergentcharging session, simplify a charging architecture, and improveflexibility of service provisioning of an operator.

Optionally, in step 202, the first online charging request includes afirst quota application, and the first offline charging request includesconsumption information statistics, or the first offline chargingrequest includes a second quota application and first indicationinformation, indicating that the applied second quota is a virtualquota.

In an embodiment, when the charging type of the first data flow isonline charging, the first message includes the first online chargingrequest of the first data flow, and the first online charging requestincludes the first quota application.

When the charging type of the second data flow is offline charging, thefirst message includes the first offline charging request of the seconddata flow, and the first offline charging request includes theconsumption information statistics.

When the charging type of the second data flow is offline charging, thefirst message includes the first offline charging request of the seconddata flow, the first offline charging request includes the second quotaapplication and the first indication information, and the firstindication information is used to indicate that the second quota is avirtual quota.

When the first data flow is online charging and the second data flow isoffline charging, the first message includes the first online chargingrequest of the first data flow and the first offline charging request ofthe second data flow, the first online charging request includes thefirst quota application, and the first offline charging request includesthe consumption information statistics.

When the first data flow is online charging and the second data flow isoffline charging, the first message includes the first online chargingrequest of the first data flow and the first offline charging request ofthe second data flow, the first online charging request includes thefirst quota application, the first offline charging request includes thesecond quota application and the first indication information, and thefirst indication information is used to indicate that the second quotais a virtual quota.

The virtual quota is a virtual quota allocated by the charging server tothe offline charging request, the virtual quota means that accountbalance is not actually deducted, and the SMF uses the virtual quotaaccording to a normal quota use method. After receiving the reportedvirtual quota, the charging server writes a CDR instead of deducting aquota.

In step 204, optionally, the response information of the first onlinecharging request includes a first quota allocated to the first quotaapplication of the first data flow, and when the first offline chargingrequest includes the consumption information statistics, the responseinformation of the first offline charging includes a processing resultof the consumption information statistics, or when the first offlinecharging request includes the second quota application and the firstindication information, the response information of the first offlinecharging includes a second quota allocated to the second quotaapplication of the second data flow and the first indicationinformation.

In an embodiment, when the first online charging request includes thefirst quota application, the charging server allocates the first quotaafter receiving the first online charging request. When the firstoffline charging request includes the consumption informationstatistics, the charging server generates a charging data record. Whenthe first offline charging request includes the second quota applicationand the first indication information, the charging server allocates thesecond quota based on the second quota application and the firstindication information.

Optionally, the second message may further include an identifiercorresponding to the first quota, and the identifier is used toindicate, when the SMF reports use information of the first quota to thecharging server, to the charging server that the reported useinformation is usage of the first quota.

Optionally, the second message may further include a trigger conditioncorresponding to the first data flow.

For example, in the case of the online charging request, the secondmessage includes the following content.

Granted Quota{ RG=1, value=30 M, Quota ID=00001 //quota id Trigger }

Where Trigger indicates a trigger condition, Quota ID is an identifiercorresponding to an authorized quota of 30 M, and RG indicates a ratinggroup corresponding to the authorized quota.

According to the technical solution provided in this embodiment of thisapplication, the charging server processes, based on the first onlinecharging request, the first offline charging request, or the firstonline charging request and the first offline charging request that aresent by the SMF to the charging server using the online-offlineconvergent charging session, the first online charging request and thefirst offline charging request, to request online charging and offlinecharging based on the online-offline convergent charging session,simplify a charging architecture, and improve flexibility of serviceprovisioning of an operator.

FIG. 3 is a schematic flowchart of a convergent charging method 300according to an embodiment of this application. A difference from theembodiment in FIG. 2 lies in that the embodiment in FIG. 3 furtherincludes step 306 to step 308 after step 205 in the embodiment in FIG.2.

Step 306. The SMF sends a third message to the charging server.

Optionally, when a first charging trigger condition of the first dataflow is satisfied, the SMF sends the third message to the chargingserver using the online-offline convergent charging session. The thirdmessage includes a second online charging request of the first dataflow.

Optionally, when a second charging trigger condition of the second dataflow is satisfied, the SMF sends the third message to the chargingserver using the online-offline convergent charging session, where thethird message includes a second offline charging request of the seconddata flow.

Optionally, when a first charging trigger condition of the first dataflow is satisfied and a second charging trigger condition of the seconddata flow is satisfied, the SMF sends the third message to the chargingserver using the online-offline convergent charging session, where thethird message includes a second online charging request of the firstdata flow and a second offline charging request of the second data flow.

It should be understood that, for online charging, the trigger conditionincludes at least one of a trigger condition preconfigured on the SMFand a trigger condition delivered by the charging server, and foroffline charging, the trigger condition is preconfigured on the SMF.

The SMF may send the online charging request and the offline chargingrequest using a same message, for example, the third message.Alternatively, the SMF may send the online charging request and theoffline charging request using different messages.

It should be understood that the first charging trigger condition may bea geographical location condition of a terminal device corresponding tothe first data flow. For example, when a location of the terminal devicechanges, the first charging trigger condition is satisfied, and the SMFneeds to send the third message to the charging server. Alternatively,the first charging trigger condition may be a change in an accessnetwork or a core network of a terminal device corresponding to thefirst data flow. For example, when the terminal device is handed overfrom a 3G system to a 4G system, the first charging trigger condition issatisfied, and the SMF needs to send the third message to the chargingserver. Alternatively, the first charging trigger condition may be aquota. For example, when the quota is used up to 90%, the first chargingtrigger condition is satisfied, and the SMF needs to send the thirdmessage to the charging server. The second charging trigger condition issimilar to the first charging trigger condition.

Optionally, the second online charging request includes at least one ofa third quota application and use information of the first quota, andthe second offline charging request includes consumption informationstatistics, or the second offline charging request includes secondindication information and at least one of use information of the secondquota and a fourth quota application, and the second indicationinformation is used to indicate that the fourth quota or the useinformation of the second quota is a virtual quota.

In an embodiment, for the online charging request, the second onlinecharging request includes the third quota application, or the secondonline charging request includes the use information of the first quota,or the second online charging request includes the third quotaapplication and the use information of the first quota. For the offlinecharging request, the second offline charging request includes theconsumption information statistics, or the second offline chargingrequest includes the use information of the second quota and the secondindication information, and the second indication information is used toindicate that the second quota is a virtual quota, or the second offlinecharging request includes the fourth quota application and the secondindication information, and the second indication information is used toindicate that the fourth quota is a virtual quota, or the second offlinecharging request includes the use information of the second quota, thefourth quota application, and the second indication information, and thesecond indication information is used to indicate that the fourth quotaor the use information of the second quota is a virtual quota.

Optionally, the second indication information may alternatively be thefirst indication information.

Optionally, the third message further includes at least one of thirdindication information corresponding to the first data flow and fourthindication information corresponding to the second data flow, where thethird indication information is used to instruct to perform onlinecharging on the first data flow, and the fourth indication informationis used to instruct to perform offline charging on the second data flow.

In an embodiment, the third message may further include the thirdindication information corresponding to the first data flow, or thethird message may further include the fourth indication informationcorresponding to the second data flow, or the third message may furtherinclude the third indication information corresponding to the first dataflow and the fourth indication information corresponding to the seconddata flow.

When the online charging request and the offline charging request use asame rating group, the charging server cannot distinguish between theonline charging request and the offline charging request based on onlythe rating group, for example, cannot distinguish between useinformation of an online quota and offline consumption informationstatistics based on only the rating group. Therefore, the thirdindication information corresponding to the first data flow and thefourth indication information corresponding to the second data flow maybe separately added to the third message, or only the third indicationinformation corresponding to the first data flow may be added to thethird message, or only the fourth indication information correspondingto the second data flow may be added to the third message. For example,the third indication information is used to identify the use informationof the online quota, and the fourth indication information is used toidentify the offline consumption information statistics, so that thecharging server may distinguish, based on the third indicationinformation or the fourth indication information, between the useinformation of the online quota and the offline consumption informationthat are reported in the third message.

If the third message carries the third indication informationcorresponding to the first data flow, the charging server performsonline charging on the first data flow and performs offline charging onthe second data flow. If the third message carries the fourth indicationinformation corresponding to the second data flow, the charging serverperforms online charging on the first data flow and performs offlinecharging on the second data flow. If the third message carries the thirdindication information corresponding to the first data flow and thefourth indication information corresponding to the second data flow, thecharging server performs online charging on the first data flow andperforms offline charging on the second data flow.

Optionally, the third indication information may be a quota identifieror an online or offline indication.

For example, two forms are separately used to identify online chargingand offline charging, as shown below.

Example 1. A quota identifier is used to distinguish between onlinecharging and offline charging. In this example, the third messageincludes the third indication information, and the third indicationinformation is a quota identifier. Content included in the third messageis shown below.

Quota Request{//online charging request RG=1 } Usage Report{//onlinecharging request RG=1, 28 M, Quota ID=00001 // Quota ID is the thirdindication information, used to identify the online charging request }Usage Report{//offline charging request RG=1, 50 M }

Example 2. An online or offline indication is used to distinguishbetween online charging and offline charging. In this example, the thirdmessage includes the third indication information corresponding to thefirst data flow and the fourth indication information corresponding tothe second data flow. Content included in the third message is shownbelow.

Quota Request{RG=1 //online charging request } Usage Report{RG=1, 28 M,indicator=online //online charging request, indicator is the thirdindication information, used to identify the online charging request }Usage Report{RG=1, 50 M, indicator=offline //offline charging request,indicator is the fourth indication information, used to identify theoffline charging request }

In Example 1 and Example 2, RG is a rating group. It should beunderstood that, if there is no quota application with a specialidentifier in a request, it is considered by default that the request isan online charging request.

It should be understood that, the first message may further include thethird indication information corresponding to the first data flow, orthe first message may further include the fourth indication informationcorresponding to the second data flow, or the first message may furtherinclude the third indication information corresponding to the first dataflow and the fourth indication information corresponding to the seconddata flow, where the third indication information is used to instruct toperform the online charging on the first data flow, and the fourthindication information is used to instruct to perform the offlinecharging on the second data flow.

It should be understood that, that the third message further includesthe third indication information corresponding to the first data flowand the fourth indication information corresponding to the second dataflow is also applicable to a case in which the online charging requestand the offline charging request use different rating groups. In anembodiment, when the online charging request and the offline chargingrequest use different rating groups, the third message further includesat least one of the third indication information corresponding to thefirst data flow and the fourth indication information corresponding tothe second data flow, where the third indication information is used toinstruct to perform online charging on the first data flow, and thefourth indication information is used to instruct to perform offlinecharging on the second data flow.

It should be understood that the third message has a response messagecorresponding to the third message. When the third message includes thesecond online charging request of the first data flow, the responsemessage of the third message includes response information of the secondonline charging request. When the third message includes the secondoffline charging request of the second data flow, the response messageof the third message includes response information of the second offlinecharging request. When the third message includes the second onlinecharging request of the first data flow and the second offline chargingrequest of the second data flow, the response message of the thirdmessage includes response information of the second online chargingrequest and response information of the second offline charging request.

Step 307. The charging server receives the third message sent by theSMF.

Step 308. The charging server performs at least one of online chargingand offline charging based on the third message sent by the SMF.

Optionally, for online charging, the charging server deducts thereserved first quota based on the use information of the first quota, orthe charging server allocates the third quota based on the third quotaapplication, or the charging server deducts the reserved first quotabased on the use information of the first quota and allocates the thirdquota based on the third quota application. For offline charging, thecharging server generates a charging data record based on theconsumption information statistics, or the charging server generates acharging data record based on consumption information of the secondquota and the second indication information, or the charging serverallocates the fourth quota based on the fourth quota application and thesecond indication information, or the charging server generates acharging data record based on the second quota and the second indicationinformation and allocates the fourth quota.

According to the technical solution provided in this embodiment of thisapplication, the charging server processes, based on the second onlinecharging request, the second offline charging request, or the secondonline charging request and the second offline charging request that aresent by the SMF to the charging server using the online-offlineconvergent charging session, the second online charging request and thesecond offline charging request, to request online charging and offlinecharging based on the online-offline convergent charging session,simplify a charging architecture, and improve flexibility of serviceprovisioning of an operator.

FIG. 4 is a schematic flowchart of a convergent charging method 400according to an embodiment of this application. A difference from theembodiment in FIG. 3 lies in that the embodiment in FIG. 4 furtherincludes step 409 and step 410 before step 306 in the embodiment in FIG.3.

Step 409. Before the SMF sends the third message to the charging serverusing the online-offline convergent charging session, the SMF receives,using the online-offline convergent charging session, a fourth messagesent by the charging server, where the fourth message is used toinstruct to send the third message using the online-offline convergentcharging session.

When the first data flow and the second data flow correspond to a samerating group, when the fourth message includes the same rating group,the third message includes the second online charging request of thefirst data flow and the second offline charging request of the seconddata flow, or when the fourth message includes the same rating group andthe third indication information, the third message includes the secondonline charging request of the first data flow, or when the fourthmessage includes the same rating group and the fourth indicationinformation, the third message includes the second offline chargingrequest of the second data flow.

In an embodiment, when the online charging request and the offlinecharging request use the same rating group, the SMF cannot distinguish,based on only the rating group, between online charging and offlinecharging. Therefore, the third indication information corresponding tothe first data flow and the fourth indication information correspondingto the second data flow may be separately added to the fourth message,or the third indication information corresponding to the first data flowmay be added to the third message and the fourth indication informationis not carried, or the fourth indication information corresponding tothe second data flow may be added to the third message and the thirdindication information is not carried.

If the fourth message carries the same rating group and the thirdindication information, the third message sent by the SMF includes thesecond online charging request of the first data flow. If the fourthmessage carries the same rating group and the fourth indicationinformation, the third message sent by the SMF includes the secondoffline charging request of the second data flow.

If the fourth message includes the same rating group, the third messagesent by the SMF includes the second online charging request of the firstdata flow and the second offline charging request of the second dataflow.

The third indication information may alternatively be a quota identifieror an online or offline indication.

It should be understood that, that the fourth message includes the thirdindication information corresponding to the first data flow and thefourth indication information corresponding to the second data flow isalso applicable to a case in which the online charging request and theoffline charging request use different rating groups. In an embodiment,when the online charging request and the offline charging request usedifferent rating groups, the fourth message further includes at leastone of the third indication information corresponding to the first dataflow and the fourth indication information corresponding to the seconddata flow, where the third indication information is used to instruct toperform online charging on the first data flow, and the fourthindication information is used to instruct to perform offline chargingon the second data flow.

Step 410. The SMF receives the fourth message, and sends the thirdmessage to the charging server based on the fourth message.

It should be understood that, the fourth message has a response messagecorresponding to the fourth message, and the third message may be sentafter the response message of the fourth message.

FIG. 5 is a schematic flowchart of a convergent charging method 500according to an embodiment of this application. A difference from theembodiment in FIG. 4 lies in that the embodiment in FIG. 5 furtherincludes step 511 and step 512 before step 401 in the embodiment in FIG.4.

Step 511. Before sending the first message, the SMF sends anonline-offline convergent charging session establishment request to thecharging server, or the first message includes an online-offlineconvergent charging session establishment request.

In an embodiment, the SMF stores a PDU of a terminal device. When theSMF determines that online charging or offline charging needs to beperformed on a data service in the PDU session of the terminal device,and the current PDU session of the terminal device has no correspondingonline-offline charging convergent session, the SMF sends theonline-offline convergent charging session establishment request to thecharging server, or the SMF adds the online-offline convergent chargingsession establishment request to the first message, to establish anonline-offline convergent charging session between the SMF and thecharging server, and the online-offline convergent charging session isused to send an online charging request and an offline charging requestthat correspond to the PDU session of the terminal device.

Step 512. The charging server receives the online-offline convergentcharging session establishment request, to establish the online-offlineconvergent charging session.

It should be understood that, if the SMF sends the online-offlineconvergent charging session establishment request to the charging serverbefore sending the first message, the method further includes returning,by the charging server, a response to the online-offline convergentcharging session establishment request to the SMF.

It should be understood that, if the first message includes theonline-offline convergent charging session establishment request, thesecond message further includes the response to the online-offlineconvergent charging session establishment request.

Optionally, the method 500 further includes, when the SMF determinesthat online charging and offline charging do not need to be performed,sending, by the SMF, a fifth message to the charging server, to requestthe charging server to terminate the online-offline convergent chargingsession.

In an embodiment, when determining to perform online charging andoffline charging, the SMF sends the fifth message to the chargingserver, where the fifth message includes use information of a quotaallocated to the first data flow and the consumption informationstatistics of the second data flow, or use information statistics of avirtual quota of the second data flow.

It should be understood that, the fifth message may further include thethird indication information corresponding to the first data flow, orthe fifth message may further include the fourth indication informationcorresponding to the second data flow, or the fifth message may furtherinclude the third indication information corresponding to the first dataflow and the fourth indication information corresponding to the seconddata flow, where the third indication information is used to identifythe use information of the quota of the first data flow, and the fourthindication information is used to identify offline consumptioninformation of the second data flow.

It should be understood that, when the PDU session corresponding to theonline-offline convergent charging session is terminated, or aninstruction for terminating the online-offline convergent chargingsession from the charging server is received, or there is no servicetraffic for a long time, or an instruction for performing no onlinecharging and offline charging that is delivered by a PCF is received,the SMF may determine that online charging and offline charging do notneed to be performed.

The charging server receives the fifth message, performs online chargingand offline charging based on the fifth message, and terminates theonline-offline convergent charging session.

In an embodiment, the charging server deducts a reserved quota based onthe use information of the quota of the first data flow, or the chargingserver generates a charging data record based on the consumptioninformation statistics of the second data flow, or based on the useinformation statistics of the virtual quota of the second data flow andthe second indication information of the second data flow, andterminates the online-offline convergent charging session.

Optionally, the method 500 further includes obtaining, by the SMF, astatic charging policy, or obtaining a dynamic charging policy of thePCF, where the dynamic charging policy and the static charging policyinclude the charging types of the first data flow and the second dataflow, and determining, by the SMF according to the dynamic chargingpolicy or the static charging policy, that the first data flow is onlinecharging and the second data flow is offline charging.

In an embodiment, the charging policy includes the charging types of thefirst data flow and the second data flow. The SMF may determine thecharging types of the first data flow and the second data flow accordingto the static charging policy stored by the SMF, or the SMF receives thedynamic charging policy sent by the PCF, and determines the chargingtypes of the first data flow and the second data flow according to thedynamic charging policy. Charging policy parameters may includeparameters shown in Table 1.

TABLE 1 Charging policy parameters Rating Group: rating group Serviceidentifier: service identifier Sponsor Identifier: sponsor identifierApplication Provider Identifier: application provider identifierCharging method: online or offline or neither: charging method: onlineor offline or neither Measurement method: volume, duration, combinedvolume/duration or event: measurement method: traffic, duration,combined traffic and duration, or event Reporting Level: reporting level

FIG. 6 is a schematic flowchart of a convergent charging method 600according to this application. The method 600 may be applied to thescenario shown in FIG. 1, and certainly, may also be applied to anothercommunication scenario. This is not limited in this embodiment of thisapplication. As shown in FIG. 6, the method 600 includes the followingcontent.

Step 601. An SMF sends a first message to a charging server using anonline-offline convergent charging session, where the first messageincludes a first quota application of a first data flow, or the firstmessage includes a second quota application of a second data flow, orthe first message includes a first quota application of a first dataflow and a second quota application of a second data flow, and theonline-offline convergent charging session is used to send a firstonline charging request and the first offline charging request.

It should be understood that the online-offline convergent chargingsession may be used to process not only online charging but also offlinecharging. The SMF may send the first quota application of the first dataflow and the second quota application of the second data flow using asame message, or the SMF may send the first quota application of thefirst data flow and the second quota application of the second data flowusing different messages.

Step 602. The charging server receives, using the online-offlineconvergent charging session, the first message sent by the SMF.

Step 603. The charging server determines charging types of the firstdata flow and the second data flow based on the first message and acharging policy.

Step 604. The charging server sends a second message to the SMF usingthe online-offline convergent charging session based on the chargingtypes of the first data flow and the second data flow.

When the charging server determines that the first data flow included inthe first message is online charging, the second message includes afirst quota allocated by the charging server to the first data flow.

When the charging server determines that the second data flow includedin the first message is offline charging, the second message includes asecond quota allocated by the charging server to the second data flowand first indication information allocated to the second data flow, andthe first indication information is used to instruct the SMF to performoffline charging on the second data flow, or the second message includesa second quota that are allocated by the charging server to the seconddata flow and second indication information, and the second indicationinformation is used to indicate that the second quota is a virtualquota. The first indication information may be the same as the secondindication information.

Step 605. The SMF receives the second message using the online-offlineconvergent charging session.

Therefore, in this embodiment of this application, the SMF sends thefirst message to the charging server using the online-offline convergentcharging session, where the first message includes the first quotaapplication of the first data flow, or the first message includes thesecond quota application of the second data flow, or the first messageincludes the first quota application of the first data flow and thesecond quota application of the second data flow, to request onlinecharging and offline charging based on the online-offline convergentcharging session, simplify a charging architecture, and improveflexibility of service provisioning of an operator.

Optionally, in step 603, the determining, by the charging server,charging types of the first data flow and the second data flow based onthe first message and a charging policy includes determining, by thecharging server according to the charging policy, that the first dataflow is online charging and the second data flow is offline charging.

In an embodiment, the charging policy includes the charging types of thefirst data flow and the second data flow, and the charging server maydetermine the charging types of the first data flow and the second dataflow according to the charging policy. Charging policy parameters mayinclude parameters shown in Table 2.

TABLE 2 Charging policy parameters Charging policy parameters RatingGroup: rating group Service identifier: service identifier SponsorIdentifier: sponsor identifier Application Service Provider Identifier:application provider identifier Charging method: online or offline orneither: charging type: online or offline or neither Measurement method:volume, duration, combined volume/duration or event: counting method:traffic, duration, combined traffic and duration, or event ReportingLevel: reporting level Flow information: flow information

Optionally, the method 600 further includes, when a PCF establishes aPDU session, receiving, by the charging server, a charging policy sentby the PCF and corresponding to the PDU session, or when receiving thefirst message sent by the SMF, requesting, by the charging server, acharging policy corresponding to the PDU session from a PCF.

In an embodiment, when establishing a PDU session for accessing anetwork by a terminal device, the PCF obtains accumulated charginginformation from the charging server, for policy decision-making. Inthis case, the PCF may send a charging policy related to the PDU sessionof the terminal device to the charging server. In this way, informationexchange between the PCF and the charging server is reduced. However,the charging policy in this case is not a charging policy obtained afterpolicy decision-making by the PCF. Therefore, the charging server needsto associate the charging policy of the PCF with the online-offlineconvergent charging session, to determine the online charging requestand the offline charging request according to the charging policy.

Optionally, when the first data flow and the second data flow use a samerating group, when it is determined that the charging type of the firstdata flow is online charging, the second message further includes flowinformation of the first data flow corresponding to the first quota, orwhen it is determined that the charging type of the second data flow isoffline charging, the second message includes flow information of thesecond data flow corresponding to the first indication information, orwhen it is determined that the charging type of the first data flow isoffline charging, the second message includes flow information of thesecond data flow corresponding to the second quota.

In an embodiment, if the charging types of the first data flow and thesecond data flow are different, but the first data flow and the seconddata flow use the same rating group to request a quota, when thecharging server sends an offline message corresponding to the ratinggroup to the SMF, the charging server may deliver the flow informationcorresponding to the second data flow corresponding to the second quota,or may deliver the flow information corresponding to the first data flowcorresponding to the first quota, and based on the flow information, theSMF performs online reporting on the first data flow and performsoffline reporting on the second data flow.

It should be understood that the flow information may be a flowidentifier or a flow feature (such as a quintuple a source InternetProtocol (IP) address, a source port, a destination IP address, adestination port, and a transport layer protocol). If the SMF has acorrespondence between a flow identifier and a flow feature, the SMFdelivers the flow identifier, otherwise, delivers a specific flowfeature.

It should be understood that, that the second message includes the flowinformation corresponding to the first data flow and/or the flowinformation corresponding to the second data flow is also applicable toa case in which the online charging and the offline charging usedifferent rating groups.

FIG. 7 is a schematic flowchart of a convergent charging method 700according to an embodiment of this application. A difference from theembodiment in FIG. 6 lies in that the embodiment in FIG. 7 furtherincludes step 706 to step 708 after step 605 in the embodiment in FIG.6.

Step 706. The SMF sends a third message to the charging server.

Optionally, when a first charging trigger condition of the first dataflow is satisfied, the SMF sends the third message to the chargingserver using the online-offline convergent charging session, where thethird message includes a third quota application of the first data flowand/or consumption information of the first quota.

Optionally, when a second charging trigger condition of the second dataflow is satisfied, the SMF sends the third message to the chargingserver using the online-offline convergent charging session, where thethird message includes consumption information statistics of the seconddata flow or a fourth quota application, and second indicationinformation, and the second indication information is used to indicatethat the fourth quota is a virtual quota.

Optionally, when a second charging trigger condition of the second dataflow is satisfied, the SMF sends the third message to the chargingserver using the online-offline convergent charging session, where thethird message includes use information statistics of the second quota ora fourth quota application, and second indication information, and thesecond indication information is used to indicate that the fourth quotais a virtual quota.

Optionally, when a first charging trigger condition of the first dataflow is satisfied and a second charging trigger condition of the seconddata flow is satisfied, the SMF sends the third message to the chargingserver using the online-offline convergent charging session, where thethird message includes a third quota application of the first data flowand/or consumption information of the first quota, consumptioninformation statistics of the second data flow or a fourth quotaapplication, and second indication information, and the secondindication information is used to indicate that the fourth quota is avirtual quota, or the third message includes a third quota applicationof the first data flow and/or consumption information of the firstquota, use information statistics of the second quota or a fourth quotaapplication, and second indication information, and the secondindication information is used to indicate that the fourth quota is avirtual quota.

It should be understood that, for online charging, the trigger conditionincludes at least one of a trigger condition preconfigured on the SMFand a trigger condition delivered by the charging server, and foroffline charging, the trigger condition is preconfigured on the SMF.

For explanations of the charging trigger condition, refer to relateddescriptions of the charging trigger condition in the method 300. Toavoid repetition, details are not described herein again.

Optionally, the charging server receives, using the online-offlineconvergent charging session, the third message sent by the SMF, wherethe third message includes at least one of the third quota applicationof the first data flow and the consumption information of the firstquota, or the consumption information statistics of the second data flowor the fourth quota application, and the second indication information,or consumption information of the second quota and the second indicationinformation, and the second indication information is used to indicate avirtual quota.

Optionally, the third message further includes third indicationinformation corresponding to the first data flow and/or fourthindication information corresponding to the second data flow, where thethird indication information is used to instruct to perform onlinecharging on the first data flow, and the fourth indication informationis used to instruct to perform offline charging on the second data flow.

In an embodiment, the third message may further include the thirdindication information corresponding to the first data flow, or thethird message may further include the fourth indication informationcorresponding to the second data flow, or the third message may furtherinclude the third indication information corresponding to the first dataflow and the fourth indication information corresponding to the seconddata flow.

When the online charging request and the offline charging request usethe same rating group, the charging server cannot distinguish betweenthe online charging request and the offline charging request based ononly the rating group. Therefore, the third indication informationcorresponding to the first data flow and the fourth indicationinformation corresponding to the second data flow may be separatelyadded to the third message, or the third indication informationcorresponding to the first data flow may be added to the third message,or the fourth indication information corresponding to the second dataflow may be added to the third message.

If the third message carries only the third indication informationcorresponding to the first data flow, the charging server performsonline charging on the first data flow and performs offline charging onthe second data flow. If the third message carries only the fourthindication information corresponding to the second data flow, thecharging server performs online charging on the first data flow andperforms offline charging on the second data flow. If the third messagecarries the third indication information corresponding to the first dataflow and the fourth indication information corresponding to the seconddata flow, the charging server performs online charging on the firstdata flow and performs offline charging on the second data flow.

Optionally, the third indication information may be a quota identifieror an online or offline indication.

Step 707. The charging server receives the third message sent by theSMF.

Step 708. The charging server performs online charging, or offlinecharging, or online charging and offline charging based on the thirdmessage.

Optionally, for online charging, the charging server deducts thereserved first quota based on the consumption information of the firstquota, or the charging server allocates the third quota based on thethird quota application, or the charging server deducts the reservedfirst quota based on the use information of the first quota, andallocates the third quota based on the third quota application. Foroffline charging, the charging server generates a charging data recordbased on the consumption information statistics of the second data flow,or the charging server allocates the fourth quota based on the fourthquota application and the second indication information, or the chargingserver generates a charging data record based on the consumptioninformation of the second quota and the second indication information,or the charging server generates a charging data record based on thesecond quota and the second indication information, and allocates thefourth quota.

FIG. 8 is a schematic flowchart of a convergent charging method 800according to an embodiment of this application. A difference from theembodiment in FIG. 7 lies in that the embodiment in FIG. 8 furtherincludes step 809 and step 810 before step 706 in the embodiment in FIG.7.

Step 809. Before the SMF sends the third message to the charging serverusing the online-offline convergent charging session, the SMF receives,using the online-offline convergent charging session, a fourth messagesent by the charging server, where the fourth message is used toinstruct to send the third message using the online-offline convergentcharging session.

When the first data flow and the second data flow correspond to a samerating group, when the fourth message includes the same rating group,the third message includes the second online charging request of thefirst data flow and the second offline charging request of the seconddata flow, or when the fourth message includes the same rating group andthe third indication information, the third message includes the secondonline charging request of the first data flow, or when the fourthmessage includes the same rating group and the fourth indicationinformation, the third message includes the second offline chargingrequest of the second data flow.

Step 810. The SMF receives the fourth message.

FIG. 9 is a schematic flowchart of a convergent charging method 900according to an embodiment of this application. A difference from theembodiment in FIG. 8 lies in that the embodiment in FIG. 9 furtherincludes step 911 and step 912 before step 801 in the embodiment in FIG.8.

Step 911. Before the SMF sends the first message to the charging serverusing the online-offline convergent charging session, the SMF sends anonline-offline convergent charging session establishment request to thecharging server, or the first message includes an online-offlineconvergent charging session establishment request.

In an embodiment, the SMF stores a PDU session of a terminal device.When the SMF determines that online charging or offline charging needsto be performed on a data service in the PDU session of the terminaldevice, and the current PDU session of the terminal device has nocorresponding online-offline charging convergent session, the SMF sendsthe online-offline convergent charging session establishment request tothe charging server, or the SMF adds the online-offline convergentcharging session establishment request to the first message, toestablish an online-offline convergent charging session between the SMFand the charging server, and the online-offline convergent chargingsession is used to send an online charging request and an offlinecharging request that correspond to the PDU session of the terminaluser.

Step 912. The charging server receives the online-offline convergentcharging session establishment request, to establish the online-offlineconvergent charging session.

Optionally, the method 900 further includes, when the SMF determinesthat online charging and offline charging do not need to be performed,sending, by the SMF, a fifth message to the charging server, to requestthe charging server to terminate the online-offline convergent chargingsession.

In an embodiment, when determining to perform online charging andoffline charging, the SMF sends the fifth message to the chargingserver, where the fifth message includes use information of a quotaallocated to the first data flow and the consumption informationstatistics of the second data flow, or use information statistics of avirtual quota of the second data flow.

It should be understood that, when the PDU session corresponding to theonline-offline convergent charging session is terminated, or aninstruction for terminating the online-offline convergent chargingsession from the charging server is received, or there is no servicetraffic for a long time, or an instruction for performing no onlinecharging and offline charging that is delivered by a PCF is received,the SMF may determine that online charging and offline charging do notneed to be performed.

The charging server receives the fifth message, performs online chargingand offline charging based on the fifth message, and terminates theonline-offline convergent charging session.

In an embodiment, the charging server deducts a reserved quota based onthe use information of the quota allocated to the first data flow, andthe charging server generates a charging data record based on theconsumption information statistics of the second data flow, or based onthe use information statistics of the virtual quota of the second dataflow and the second indication information of the second data flow, andterminates the online-offline convergent charging session.

FIG. 10 is a schematic block diagram of a SMF 1000 according to thisapplication. As shown in FIG. 10, the SMF 1000 includes a determiningmodule 1010 configured to determine charging types of a first data flowand a second data flow, where the charging type is online charging oroffline charging, and a sending module 1020 configured to send a firstmessage to a charging server using an online-offline convergent chargingsession based on the charging types of the first data flow and thesecond data flow, where the first message includes a first onlinecharging request of the first data flow, or the first message includes afirst offline charging request of the second data flow, or the firstmessage includes a first online charging request of the first data flowand a first offline charging request of the second data flow, and theonline-offline convergent charging session is used to send the firstonline charging request and the first offline charging request.

Optionally, the first online charging request includes a first quotaapplication, and the first offline charging request includes consumptioninformation statistics, or the first offline charging request includes asecond quota application and first indication information indicatingthat an applied second quota is a virtual quota.

Optionally, the SMF further includes a receiving module configured toreceive, using the online-offline convergent charging session, a secondmessage sent by the charging server, where the second message includesat least one of response information of the first online chargingrequest and/or response information of the first offline chargingrequest, the response information of the first online charging requestincludes a first quota allocated to the first quota application of thefirst data flow, and when the first offline charging request includesthe consumption information statistics, the response information of thefirst offline charging includes a processing result of the consumptioninformation statistics, or when the first offline charging requestincludes the second quota application and the first indicationinformation, the response information of the first offline chargingincludes a second quota allocated to the second quota application of thesecond data flow and the first indication information.

Optionally, the sending module is further configured to, when a firstcharging trigger condition of the first data flow is satisfied, send athird message to the charging server using the online-offline convergentcharging session, where the third message includes a second onlinecharging request of the first data flow, or when a second chargingtrigger condition of the second data flow is satisfied, send a thirdmessage to the charging server using the online-offline convergentcharging session, where the third message includes a second offlinecharging request of the second data flow, or when a first chargingtrigger condition of the first data flow is satisfied and a secondcharging trigger condition of the second data flow is satisfied, send athird message to the charging server using the online-offline convergentcharging session, where the third message includes a second onlinecharging request of the first data flow and a second offline chargingrequest of the second data flow.

Optionally, the second online charging request includes at least one ofa third quota application and use information of the first quota, andthe second offline charging request includes consumption informationstatistics, or the second offline charging request includes secondindication information and at least one of use information of the secondquota and a fourth quota application, and the second indicationinformation is used to indicate that the fourth quota or the useinformation of the second quota is a virtual quota.

Optionally, the third message further includes at least one of thirdindication information corresponding to the first data flow and fourthindication information corresponding to the second data flow, where thethird indication information is used to instruct to perform onlinecharging on the first data flow, and the fourth indication informationis used to instruct to perform offline charging on the second data flow.

Optionally, the receiving module is further configured to, before thethird message is sent to the charging server using the online-offlineconvergent charging session, receive, using the online-offlineconvergent charging session, a fourth message sent by the chargingserver, where the fourth message is used to instruct to send the thirdmessage using the online-offline convergent charging session, and whenthe first data flow and the second data flow correspond to a same ratinggroup, when the fourth message includes the same rating group, the thirdmessage includes the second online charging request of the first dataflow and the second offline charging request of the second data flow, orwhen the fourth message includes the same rating group and the thirdindication information, the third message includes the second onlinecharging request of the first data flow, or when the fourth messageincludes the same rating group and the fourth indication information,the third message includes the second offline charging request of thesecond data flow.

Optionally, the sending module is further configured to, before sendingthe first message, send an online-offline convergent charging sessionestablishment request to the charging server, or send the first messageto the charging server, where the first message includes anonline-offline convergent charging session establishment request.

Optionally, the sending module is further configured to, when it isdetermined that online charging and offline charging do not need to beperformed, send a fifth message to the charging server, to request thecharging server to terminate the online-offline convergent chargingsession.

Optionally, the SMF further includes an obtaining module, where theobtaining module is configured to obtain a static charging policy orobtain a dynamic charging policy of a PCF, where the dynamic chargingpolicy and the static charging policy include the charging types of thefirst data flow and the second data flow, and the determining module isfurther configured to determine, by the SMF according to the dynamiccharging policy or the static charging policy, that the charging type ofthe first data flow is online charging and the charging type of thesecond data flow is offline charging.

Optionally, the SMF 1000 is configured to perform various operationsperformed by the SMF in the convergent charging method 200 to theconvergent charging method 500 in this application. For brevity, detailsare not described herein again.

FIG. 11 is a schematic block diagram of a charging server 1100 accordingto this application. As shown in FIG. 11, the charging server 1100includes a receiving module 1110 configured to receive, using anonline-offline convergent charging session, a first message sent by aSMF, where the first message includes a first online charging request ofthe first data flow, or the first message includes a first offlinecharging request of the second data flow, or the first message includesa first online charging request of the first data flow and a firstoffline charging request of the second data flow, and the online-offlineconvergent charging session is used to send the first online chargingrequest and the first offline charging request, and a sending module1120 configured to send a second message to the SMF, where when thefirst message includes the first online charging request of the firstdata flow, the second message includes response information of the firstonline charging request, when the first message includes the firstoffline charging request of the second data flow, the second messageincludes response information of the first offline charging request, orwhen the first message includes the first online charging request of thefirst data flow and the first offline charging request of the seconddata flow, the second message includes response information of the firstonline charging request and response information of the first offlinecharging request.

Optionally, the response information of the first online chargingrequest includes a first quota allocated to a first quota application ofthe first data flow, and when the first offline charging requestincludes the consumption information statistics, the responseinformation of the first offline charging includes a processing resultof the consumption information statistics, or when the first offlinecharging request includes the second quota application and firstindication information, the response information of the first offlinecharging includes a second quota allocated to the second quotaapplication of the second data flow and the first indicationinformation.

Optionally, the receiving module is further configured to receive, usingthe online-offline convergent charging session, a third message sent bythe SMF, where the third message includes a second online chargingrequest of the first data flow, or a second offline charging request ofthe second data flow, or a second online charging request of the firstdata flow and a second offline charging request of the second data flow.

Optionally, the second online charging request includes at least one ofa third quota application and consumption information of the firstquota, and the second offline charging request includes the consumptioninformation statistics, or the second offline charging request includesconsumption information of the second quota or a fourth quotaapplication, and second indication information, and the secondindication information is used to indicate that a fourth quota is avirtual quota.

Optionally, the third message further includes third indicationinformation corresponding to the first data flow and/or fourthindication information corresponding to the second data flow, where thethird indication information is used to instruct to perform onlinecharging on the first data flow, and the fourth indication informationis used to instruct to perform offline charging on the second data flow.

Optionally, the charging server further includes a processing moduleconfigured to deduct the reserved first quota based on the useinformation of the first quota, or allocate the third quota based on thethird quota application, or generate a charging data record based on theconsumption information statistics, or generate a charging data recordbased on the consumption information of the second quota and the secondindication information, or allocate the fourth quota based on the fourthquota application and the second indication information.

Optionally, the sending module is further configured to, before thethird message is received, send a fourth message to the SMF using theonline-offline convergent charging session, where the fourth message isused to instruct to send the third message using the online-offlineconvergent charging session, and when the first data flow and the seconddata flow correspond to a same rating group, when the fourth messageincludes the same rating group, the third message includes the secondonline charging request of the first data flow and the second offlinecharging request of the second data flow, or when the fourth messageincludes the same rating group and the third indication information, thethird message includes the second online charging request of the firstdata flow, or when the fourth message includes the same rating group andthe fourth indication information, the third message includes the secondoffline charging request of the second data flow.

Optionally, the receiving module is further configured to, beforereceiving the first message, receive an online-offline convergentcharging session request sent by the SMF, to establish theonline-offline convergent charging session, or receive the first messageincluding an online-offline convergent charging session establishmentrequest, to establish the online-offline convergent charging session.

Optionally, the receiving module is further configured to receive, bythe charging server, a fifth message sent by the SMF, and the processingmodule is further configured to terminate the online-offline convergentcharging session based on the fifth message.

Optionally, the charging server 1100 is configured to perform variousoperations performed by the charging server in the convergent chargingmethod 200 to the convergent charging method 500 in this application.For brevity, details are not described herein again.

FIG. 12 is a schematic block diagram of a SMF 1200 according to thisapplication. As shown in FIG. 12, the SMF 1200 includes a sending module1210 configured to send a first message to a charging server using anonline-offline convergent charging session, where the first messageincludes a first quota application of a first data flow, or the firstmessage includes a second quota application of the second data flow, orthe first message includes a first quota application of a first dataflow and a second quota application of the second data flow, and theonline-offline convergent charging session is used to send the firstonline charging request and the first offline charging request, and areceiving module 1220 configured to receive, using the online-offlineconvergent charging session, a second message sent by the chargingserver, where when the first message includes the first quotaapplication of the first data flow, the second message includes a firstquota allocated by the charging server to the first data flow, when thefirst message includes the second quota application of the second dataflow, the second message includes a second quota allocated to the seconddata flow and first indication information allocated to the second dataflow, and the first indication information is used to instruct the SMFto perform offline charging on the second data flow, or the secondmessage includes the second quota that are allocated by the chargingserver to the second data flow and second indication information, andthe second indication information is used to indicate that the secondquota is a virtual quota, or when the first message includes the firstquota application of the first data flow and the second quotaapplication of the second data flow, the second message includes a firstquota allocated by the charging server to the first data flow, thesecond quota application of the second data flow, and first indicationinformation allocated to the second data flow, and the first indicationinformation is used to instruct the SMF to perform offline charging onthe second data flow, or a second message includes the first quotaallocated by the charging server to the first data flow and the secondquota that are allocated by the charging server to the second data flowand second indication information, and the second indication informationis used to indicate that the second quota is a virtual quota.

Optionally, the SMF 1200 is configured to perform various operationsperformed by the SMF in the convergent charging method 600 to theconvergent charging method 900 in this application. For brevity, detailsare not described herein again.

FIG. 13 is a schematic block diagram of a charging server 1300 accordingto this application. As shown in FIG. 13, the charging server 1300includes a receiving module 1310 configured to receive, using anonline-offline convergent charging session, a first message sent by aSMF, where the first message includes a first quota application of afirst data flow, or the first message includes a second quotaapplication of the second data flow, or the first message includes afirst quota application of a first data flow and a second quotaapplication of the second data flow, and the online-offline convergentcharging session is used to send the first online charging request andthe first offline charging request, and a determining module 1320configured to determine charging types of the first data flow and thesecond data flow, where the charging type is online charging or offlinecharging, and a sending module 1330 configured to send a second messageto the SMF using the online-offline convergent charging session based onthe charging types of the first data flow and the second data flow,where when the first message includes the first quota application of thefirst data flow, the second message includes a first quota allocated bythe charging server to the first data flow, when the first messageincludes the second quota application of the second data flow, thesecond message includes the second quota application of the second dataflow and first indication information allocated to the second data flow,and the first indication information is used to instruct the SMF toperform offline charging on the second data flow, or the second messageincludes the second quota that are allocated by the charging server tothe second data flow and second indication information, and the secondindication information is used to indicate that the second quota is avirtual quota, or when the first message includes the first quotaapplication of the first data flow and the second quota application ofthe second data flow, the second message includes a first quotaallocated by the charging server to the first data flow, the secondquota application of the second data flow, and first indicationinformation allocated to the second data flow, and the first indicationinformation is used to instruct the SMF to perform offline charging onthe second data flow, or the second message includes a first quotaallocated by the charging server to the first data flow and the secondquota that are allocated by the charging server to the second data flowand second indication information, and the second indication informationis used to indicate that the second quota is a virtual quota.

Optionally, the charging server 1300 is configured to perform variousoperations performed by the charging server in the convergent chargingmethod 600 to the convergent charging method 900 in this application.For brevity, details are not described herein again.

The SMF and the charging server completely correspond to the SMF and thecharging server in the method embodiments, and corresponding modulesperform corresponding steps. For details, refer to the correspondingmethod embodiments.

FIG. 14 is a schematic block diagram of a communications apparatus 1400according to this application. The communications apparatus 1400includes a memory 1410 configured to store a program, where the programincludes code, a transceiver 1420 configured to communicate with anotherdevice, and a processor 1430 configured to execute program code in thememory 1410.

Optionally, when the code is executed, the processor 1430 can implementvarious operations in the method 200 or the method 300. For brevity,details are not described herein again. In this case, the communicationsapparatus 1400 may be a SMF or a charging server. The transceiver 1420is configured to send and receive a specific signal when driven by theprocessor 1430.

This application provides a chip system, including at least oneprocessor. The at least one processor is configured to execute a storedinstruction, to enable the SMF to implement various operations in themethod 200 to the method 900.

This application provides a chip system, including at least oneprocessor. The at least one processor is configured to execute a storedinstruction, to enable the charging server to implement variousoperations in the method 200 to the method 900.

This application provides a computer program product. The computerprogram product includes an instruction. When the instruction isexecuted, the SMF is enabled to implement various operations in themethod 200 to the method 900.

This application provides a computer program product. The computerprogram product includes an instruction. When the instruction isexecuted, the charging server is enabled to implement various operationsin the method 200 to the method 900.

This application provides a computer storage medium. The computerstorage medium stores a program instruction. When the instruction isexecuted, the SMF is enabled to implement various operations in themethod 200 to the method 900.

This application provides a computer storage medium. The computerstorage medium stores a program instruction. When the instruction isexecuted, the charging server is enabled to implement various operationsin the method 200 to the method 900.

A person of ordinary skill in the art may be aware that, in combinationwith the examples described in the embodiments disclosed in thisspecification, units and algorithm steps may be implemented byelectronic hardware or a combination of computer software and electronichardware. Whether the functions are performed by hardware or softwaredepends on particular applications and design constraints of thetechnical solutions. A person skilled in the art may use differentmethods to implement the described functions for each particularapplication, but it should not be considered that the implementationgoes beyond the scope of this application.

It may be clearly understood by a person skilled in the art that, forthe purpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, refer to acorresponding process in the foregoing method embodiments, and detailsare not described herein again.

In the several embodiments provided in this application, it should beunderstood that the disclosed system, apparatus, and method may beimplemented in other manners. For example, the described apparatusembodiment is merely an example. For example, the unit division ismerely logical function division and may be other division in actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beimplemented using some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electrical, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all of the units may be selected based on actualrequirements to achieve the objectives of the solutions of theembodiments.

In addition, functional units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units are integrated into one unit.

When the functions are implemented in a form of a software functionalunit and sold or used as an independent product, the functions may bestored in a computer-readable storage medium. Based on such anunderstanding, the technical solutions of this application essentially,or the part contributing to the other approaches, or some of thetechnical solutions may be implemented in a form of a software product.The computer software product is stored in a storage medium, andincludes several instructions for instructing a computer device (whichmay be a personal computer, a server, a network device, or the like) toperform all or some of the steps of the methods described in theembodiments of this application. The foregoing storage medium includesany medium that can store program code, such as a universal serial busflash drive, a removable hard disk, a read-only memory (ROM), arandom-access memory (RAM), a magnetic disk, or an optical disc.

All or some of the foregoing embodiments may be implemented usingsoftware, hardware, firmware, or any combination thereof. When softwareis used to implement the embodiments, the embodiments may be all orpartially implemented in a form of a computer program product. Thecomputer program product includes one or more computer instructions.When the computer program instructions are loaded and executed on acomputer, the procedures or functions according to this application areall or partially generated. The computer may be a general-purposecomputer, a dedicated computer, a computer network, or anotherprogrammable apparatus. The computer instructions may be stored in acomputer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another web site, computer,server, or data center in a wired (for example, a coaxial cable, anoptical fiber, or a digital subscriber line) or wireless (for example,infrared, radio, and microwave, or the like) manner. Thecomputer-readable storage medium may be any usable medium accessible bya computer, or a data storage device, such as a server or a data center,integrating one or more usable media. The usable medium may be amagnetic medium (for example, a floppy disk, a hard disk, or a magnetictape), an optical medium, a semiconductor medium (for example, asolid-state drive, solid state disk (SSD)), or the like.

The foregoing descriptions are merely example implementations of thisapplication, but are not intended to limit the protection scope of thisapplication. Any variation or replacement readily figured out by aperson skilled in the art within the technical scope disclosed in thisapplication shall fall within the protection scope of this application.Therefore, the protection scope of this application shall be subject tothe protection scope of the claims.

The invention claimed is:
 1. A convergent charging method implemented bya session management function, the convergent charging methodcomprising: determining a first charging type of a first data flow and asecond charging type of a second data flow, wherein the first chargingtype is online charging, and wherein the second charging type is offlinecharging, and wherein the first data flow and the second data flow aretransmitted in a data session; sending, via an online-offline chargingsession corresponding to the data session, a first message to a chargingserver based on the first charging type and the second charging type,wherein the first message comprises a first online charging request forthe first data flow and a first offline charging request for the seconddata flow; and receiving, from the charging server via theonline-offline charging session corresponding to the data session, asecond message comprising first response information for the firstonline charging request and second response information for the firstoffline charging request.
 2. The convergent charging method of claim 1,wherein the first online charging request comprises a first quotaapplication of the first data flow, and wherein the first offlinecharging request comprises first consumption information statistics. 3.The convergent charging method of claim 2, wherein the first responseinformation comprises a first quota allocated to the first quotaapplication, and wherein the second response information comprises aprocessing result of the first consumption information statistics. 4.The convergent charging method of claim 2, further comprising sending athird message to the charging server, wherein the third messagecomprises at least one of: a second online charging request for thefirst data flow when a first charging trigger condition of the firstdata flow is satisfied; or a second offline charging request for thesecond data flow when a second charging trigger condition of the seconddata flow is satisfied.
 5. The convergent charging method of claim 4,wherein the second online charging request comprises first indicationinformation corresponding to the first data flow, and wherein the firstindication information instructs the charging server to perform onlinecharging on the first data flow; and/or wherein the second offlinecharging request comprises second indication information correspondingto the second data flow, and wherein the second indication informationinstructs the charging server to perform offline charging on the seconddata flow.
 6. The convergent charging method of claim 4, wherein thefirst data flow and the second data flow correspond to a same ratinggroup, wherein the convergent charging method further comprisesreceiving an instructing message from the charging server, and whereinthe instructing message instructs the session management function tosend the second online charging request or the second offline chargingrequest.
 7. The convergent charging method of claim 1, furthercomprising sending a terminating message to the charging server torequest the charging server to terminate the online-offline chargingsession when online charging and offline charging do not need to beperformed.
 8. A convergent charging method implemented by a chargingserver, the convergent charging method comprising: receiving, via anonline-offline charging session corresponding to a data session, a firstmessage from a session management function, wherein the first messagecomprises a first online charging request for a first data flow and afirst offline charging request for a second data flow, and the firstdata flow and the second data flow are transmitted in the data session;and sending, via the online-offline charging session, a second messageto the session management function, wherein the second message comprisesfirst response information of the first online charging request andsecond response information of the first offline charging request,wherein the first response information comprises a first quota allocatedto a first quota application of the first data flow, and wherein thesecond response information comprises a processing result of consumptioninformation statistics.
 9. The convergent charging method of claim 8,further comprising receiving, from the session management function, asecond online charging request for the first data flow and a secondoffline charging request for the second data flow.
 10. The convergentcharging method of claim 9, wherein the second online charging requestcomprises first indication information corresponding to the first dataflow, and wherein the first indication information instructs thecharging server to perform online charging on the first data flow, orwherein the second offline charging request comprises second indicationinformation corresponding to the second data flow, and wherein thesecond indication information instructs the charging server to performoffline charging on the second data flow.
 11. The convergent chargingmethod of claim 10, wherein the first data flow and the second data flowcorrespond to a same rating group, wherein the convergent chargingmethod further comprises sending an instructing message to the sessionmanagement function, and wherein the instructing message instructs thesession management function to send the second online charging requestor the second offline charging request.
 12. A session managementfunction, comprising: a processor; and a memory coupled to the processorand storing instructions that, when executed by the processor, cause theprocessor to be configured to: determine a first charging type of afirst data flow and a second charging type of a second data flow,wherein the first charging type is online charging and the secondcharging type is offline charging, and wherein the first data flow andthe second data flow are transmitted in a data session; send, via anonline-offline charging session corresponding to the data session, afirst message to a charging server based on the first charging type andthe second charging type, wherein the first message comprises a firstonline charging request for the first data flow and a first offlinecharging request for the second data flow to a charging server; andreceive via the online-offline charging session corresponding to thedata session, from the charging server, a second message comprisingfirst response information for the first online charging request andsecond response information for the first offline charging request fromthe charging server.
 13. The session management function of claim 12,wherein the first online charging request comprises a first quotaapplication of the first data flow, and wherein the first offlinecharging request comprises consumption information statistics.
 14. Thesession management function of claim 13, wherein the first responseinformation comprises a first quota allocated to the first quotaapplication, and wherein the second response information comprises aprocessing result of the consumption information statistics.
 15. Thesession management function of claim 13, wherein the instructionsfurther cause the processor to be configured to: send a second onlinecharging request for the first data flow to the charging server via theonline-offline charging session when a first charging trigger conditionof the first data flow is satisfied; and/or send a second offlinecharging request for the second data flow to the charging server via theonline-offline charging session when a second charging trigger conditionof the second data flow is satisfied.
 16. The session managementfunction of claim 15, wherein the second online charging request furthercomprises first indication information corresponding to the first dataflow, and wherein the first indication information instructs thecharging server to perform online charging on the first data flow,and/or wherein the second offline charging request comprises secondindication information corresponding to the second data flow, andwherein the second indication information instructs the charging serverto perform offline charging on the second data flow.
 17. The sessionmanagement function of claim 15, wherein the first data flow and thesecond data flow correspond to a same rating group, wherein theinstructions cause the processor to be further configured to receive aninstructing message from the charging server, and wherein theinstructing message instructs the session management function to sendthe second online charging request or the second offline chargingrequest.
 18. A charging server, comprising: a processor; and a memorycoupled to the processor and storing instructions that, when executed bythe processor, cause the processor to be configured to: receive via anonline-offline charging session corresponding to a data session, a firstmessage from a session management function, wherein the first messagecomprises a first online charging request for a first data flow and afirst offline charging request for a second data flow from a sessionmanagement function, wherein the first data flow and the second dataflow are transmitted in the data session; and send, via theonline-offline charging session, a second message to the sessionmanagement function, wherein the second message comprises first responseinformation for the first online charging request and second responseinformation for the first offline charging request to the sessionmanagement function, wherein the first response information comprises afirst quota allocated to a first quota application of the first dataflow, and wherein the second response information comprises a processingresult of consumption information statistics.
 19. The charging server ofclaim 18, wherein the instructions further cause the processor to beconfigured to receive, via the online-offline charging session, a secondonline charging request for the first data flow and a second offlinecharging request for the second data flow from the session managementfunction.
 20. A convergent charging method, comprising: determining, bya session management function, a first charging type of a first dataflow and a second charging type of a second data flow, wherein the firstcharging type is online charging, wherein the second charging type isoffline charging, and wherein the first data flow and the second dataflow are transmitted in a data session; sending, by the sessionmanagement function via an online-offline charging session correspondingto the data session, a first message to a charging server based on thefirst charging type and the second charging type, wherein the firstmessage comprises a first online charging request for the first dataflow and a first offline charging request for the second data flow; andsending, by the charging server to the session management function viathe online-offline charging session corresponding to the data session, asecond message comprising first response information for the firstonline charging request and second response information for the firstoffline charging request to the charging server.